@model CreateSitemapViewModel

<h1>@RenderTitleSegments(T["Create Sitemap"])</h1>

@if (String.IsNullOrEmpty(Site.BaseUrl))
{
    <p class="alert alert-warning">@T["The site settings 'Base url' property is empty, but is required to generate sitemaps."]</p>
}

<div asp-validation-summary="ModelOnly"></div>
<form asp-action="Create" method="post">
    <div class="form-group" asp-validation-class-for="Name">
        <label asp-for="Name">@T["Name"]</label>
        <input asp-for="Name" class="form-control" autofocus />
        <span asp-validation-for="Name" class="text-danger">@T["The name is required."]</span>
    </div>

    <div class="form-group" asp-validation-class-for="Path">
        <label asp-for="Path">@T["Permalink"]</label>
        <div class="input-group">
            @if (!String.IsNullOrWhiteSpace(Site.BaseUrl))
            {
                <div class="input-group-prepend">
                    <div class="input-group-text">@Site.BaseUrl</div>
                </div>
            }
            <input asp-for="Path" class="form-control" />
            <span asp-validation-for="Path"></span>
        </div>
        <span class="hint">@T["The url of the sitemap. Leave empty to auto-generate it."]</span>
    </div>

    <div class="form-group custom-control custom-checkbox">
        <input asp-for="Enabled" class="custom-control-input" />
        <label asp-for="Enabled" class="custom-control-label">@T["Enabled"]</label>
        <span class="hint">@T["Uncheck to disable routing to this sitemap."]</span>
    </div>

    <fieldset>
        <div class="form-group">
            <button class="btn btn-primary" type="submit">@T["Create"]</button>
            <a class="btn btn-secondary" asp-route-action="List">@T["Cancel"]</a>
        </div>
    </fieldset>
</form>
